home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Original Shareware 1.1
/
The Original Shareware (WeMake CDs)(Volume 1.1)(CDs, Inc)(1993).iso
/
18
/
fpc103.zip
/
PATHSET.SEQ
< prev
next >
Wrap
Text File
|
1988-06-30
|
2KB
|
48 lines
\ PATHSET.SEQ Words used to set the path of a file. by Tom Zimmer
0 constant flhndl \ plugged later
: ?drive.extract ( handle --- drive-value )
dup >nam 1+ c@ ascii : =
if dup >r >nam c@ bl or 96 -
r@ count 2- >r dup 2+ swap r> cmove
r@ c@ 2- r@ c! r> count + off
else drop 0 25 bdos 1+ then ;
: ?drive.prepend ( drive-value handle --- )
over 0=
if 2drop
else dup >r count >r dup 2+ r> cmove>
64 + r@ >nam c! ascii : r@ >nam 1+ c!
r@ c@ 2+ r> c!
then ;
handle pathhndl
: prepend.path ( handle --- f1 )
pathhndl clr-hcb
dup =: flhndl ?drive.extract >r
flhndl >nam c@ ascii \ =
if r> flhndl ?drive.prepend 0 exit then
ascii \ pathhndl 1+ c! 64 pathhndl c!
pathhndl 2+ r@ pdos ?dup
if r>drop exit then
pathhndl 1+ 64 0 \ determine path length
do dup i + c@ 0= if i pathhndl c! leave then
loop drop pathhndl c@ 1 >
if ascii \ pathhndl count + c! pathhndl c@ 1+ pathhndl c!
then flhndl c@ pathhndl c@ + 62 >
if r> r> 2drop true exit
then
flhndl 1+ pathhndl c@ over + flhndl c@ cmove>
pathhndl count flhndl 1+ swap cmove
pathhndl c@ flhndl c@ + flhndl c!
r> flhndl ?drive.prepend
0 flhndl count + c! 0 ;
' PREPEND.PATH IS PATHSET
handle viewpath viewpath prepend.path drop